package com.crm.jdy.common.dto;


import com.baomidou.mybatisplus.annotation.*;
import com.crm.jdy.common.vo.PageVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PermissionInfoDto extends PageVO implements Serializable {


    private static final long serialVersionUID = 167707478L;


    @TableId(value = "per_id", type = IdType.ID_WORKER_STR)
    @ApiModelProperty(name = "perId" , value = "权限主键id")
    private String perId;

    @NotBlank(message = "权限名称非空")
    @ApiModelProperty(name = "perName" , value = "权限名称")
    private String perName;

    @ApiModelProperty(name = "perUrl" , value = "权限url")
    private String perUrl;

    @NotNull(message = "权限编码不能为空")
    @ApiModelProperty(name = "perCode" , value = "权限编码")
    private String perCode;

    @NotNull(message = "父级id不能为空")
    @ApiModelProperty(name = "parentId" , value = "父级id")
    private String parentId;

    @ApiModelProperty(name = "perType" , value = "权限类型")
    private String perType;

    @ApiModelProperty(name = "perStatus" , value = "权限状态")
    private String perStatus;

    @JsonIgnore
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(name = "createTime" , value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonIgnore
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(name = "updateTime" , value = "更新最新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @JsonIgnore
    @TableLogic
    @ApiModelProperty(name = "isDelete" , value = "0正常  1删除")
    private Integer isDelete;

}
